UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LIs2Kmpjrmq/PXqkGyJBiuvF14FbAfK6S4IuZzWeOe8=' 
WHERE 
  key_id = '9d61c31ea85b125d0f1ab24f18ae974c776a68c132cef3b3baf2a41a972c9bd1' 
  AND (
    token = 'LIs2Kmpjrmq/PXqkGyJBiuvF14FbAfK6S4IuZzWeOe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030