UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5fqhOJVkeP25GTFnJV1iEeUKa7NnTMRc9TYnB3QKH+U=' 
WHERE 
  key_id = '961463179a89f4e9ba9c777dcb60b1c2f2e02f7e1b96eb28238ca88f3acae3ba' 
  AND (
    token = '5fqhOJVkeP25GTFnJV1iEeUKa7NnTMRc9TYnB3QKH+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021