UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8AsahzKVOv0Y7WvyN+IzdOUNZKa1o9jidsNOetUA6OQ=' 
WHERE 
  key_id = '8f7692d582a5ed4d2401e5fc9c687e2807fbb76abab5fc054482aadf345b3de0' 
  AND (
    token = '8AsahzKVOv0Y7WvyN+IzdOUNZKa1o9jidsNOetUA6OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034