UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1wGJApgQkIuGX7S6UFPYN9Xr24cJhvYc4V7GJr6Sg4o=' 
WHERE 
  key_id = '3ed877787c4d97d512d9a6ad8538f09348425eccfd0b885d047ad462adb0b2d8' 
  AND (
    token = '1wGJApgQkIuGX7S6UFPYN9Xr24cJhvYc4V7GJr6Sg4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022