UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '86TQ8rUAVcSea4YnQ6MSoAsvpdy4QLxkCVFP7SRXpXE=' 
WHERE 
  key_id = '5e44e9e58798b262699eebfe976d1301eb84968e1eedd6f810b2ae5bdc404e9e' 
  AND (
    token = '86TQ8rUAVcSea4YnQ6MSoAsvpdy4QLxkCVFP7SRXpXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060