UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xnyseL6fFLSBNBZB/eezBqAnDSu+EWR+5x0yisStrvs=' 
WHERE 
  key_id = 'f4eb40727da9c884a9fe1221199ff7b017e3db42544f2e942dc2fa3da9d8be9c' 
  AND (
    token = 'xnyseL6fFLSBNBZB/eezBqAnDSu+EWR+5x0yisStrvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066