UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZGVf49fqJude2z2okZm1JWDLcpobsWM4fB0a/e30Hig=' 
WHERE 
  key_id = 'fa09c85c9181e08323f722bdf0eeea9623c241a8f96eafb3989d721f5dcf0384' 
  AND (
    token = 'ZGVf49fqJude2z2okZm1JWDLcpobsWM4fB0a/e30Hig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025