UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'La+PAZ1l4AsgeiKYUkdnKDK/4lfYCK1BGgFl8Bk5tck=' 
WHERE 
  key_id = '03eebe6933067431e235e3443ad2eb910a46f7447f52f302eb48dbaa89bf146b' 
  AND (
    token = 'La+PAZ1l4AsgeiKYUkdnKDK/4lfYCK1BGgFl8Bk5tck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017