UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JrYyycWX0KP+C0RDiKGMx0/M2qQYwGd6dk6Q7S+W4VM=' 
WHERE 
  key_id = '5c0d7334a7e8367c95edc2c555edf38cdb016a9e319c315427c8ba5c76164a4d' 
  AND (
    token = 'JrYyycWX0KP+C0RDiKGMx0/M2qQYwGd6dk6Q7S+W4VM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020