UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFJx1RWNrJ4fsiVDMVj/RD4mgyZwG92TBrMveaTnxEA=' 
WHERE 
  key_id = '49f316eb2c8447e24e10174d1259701dba62c9490be77c76749a4cdea474a95e' 
  AND (
    token = 'LFJx1RWNrJ4fsiVDMVj/RD4mgyZwG92TBrMveaTnxEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017