UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKpAOohZK+jWJfr7G1J8OJwsnq9DmeceDSxc91Hxu+o=' 
WHERE 
  key_id = 'ee3fe2684c9e83399e3e75f9e12b32864a42eeab2fa158e020b50259a889ca3a' 
  AND (
    token = 'uKpAOohZK+jWJfr7G1J8OJwsnq9DmeceDSxc91Hxu+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040