UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h8/dRw245BwqQO/RHOgDnMpu9NgVQYgZdKKEd/1uWyg=' 
WHERE 
  key_id = '6f9291d790a51992dc89d1a375e8b7c53851c2548d7f550efe02093ad5eeac97' 
  AND (
    token = 'h8/dRw245BwqQO/RHOgDnMpu9NgVQYgZdKKEd/1uWyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021