UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jX262eZvfR+bItXzcHEtLEj/+T4gVHleQ5molUttbA0=' 
WHERE 
  key_id = '2311d200f865354fb0f1aa1a17d9c409e2988ec32e3eebfe746621cf1ca226b3' 
  AND (
    token = 'jX262eZvfR+bItXzcHEtLEj/+T4gVHleQ5molUttbA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042