UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RYLAmb8WyWZWGP63Cy0iOIQgHfCWV+JKJM0QDxWYeB4=' 
WHERE 
  key_id = '2fac49abe8a87f854f0a142c8e747ea5b656e754d83876ca7de35c8311f2c023' 
  AND (
    token = 'RYLAmb8WyWZWGP63Cy0iOIQgHfCWV+JKJM0QDxWYeB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044