UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPmqQyTpJilQ0jpdAlODgg9mw7wbrxydgMRK4Z7Fsx0=' 
WHERE 
  key_id = '91e5bdc8223fba1dee4aab156302b7b2f2ac2022d9df326108d446f02ff782c6' 
  AND (
    token = 'HPmqQyTpJilQ0jpdAlODgg9mw7wbrxydgMRK4Z7Fsx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019