UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H7H5CrIdndynEVwo1ANqm/Cm0UpTTUN901BnBlgjMdQ=' 
WHERE 
  key_id = '3a76615282ae1768073927106b6ea8ce9d6b113a3e93b77822848f5532cf670a' 
  AND (
    token = 'H7H5CrIdndynEVwo1ANqm/Cm0UpTTUN901BnBlgjMdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049