UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RF/PE+af+bd7AXSOoQFY20Q69//rCtdDhKw/esEkGqM=' 
WHERE 
  key_id = '61c9bb0644b99c5811378d320bb8cb44bcc78e730449421d5492cae3adc5ba61' 
  AND (
    token = 'RF/PE+af+bd7AXSOoQFY20Q69//rCtdDhKw/esEkGqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041