UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UprP87vzjhUdqBQitNihYudde5mne9cX4UQFskfA4IQ=' 
WHERE 
  key_id = 'eb642f12ef06bc4bc3a5b7369d555886ece4bebdc493d6b571b4a3e33669331b' 
  AND (
    token = 'UprP87vzjhUdqBQitNihYudde5mne9cX4UQFskfA4IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019