UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1gP39snITv6cKIxeWSVppp8eaWb/Keif6Tw7Jc60wbU=' 
WHERE 
  key_id = 'd63b759c726acff8f3611ac842aaed6fac076093172bcab805dd5cd8b7f9cf76' 
  AND (
    token = '1gP39snITv6cKIxeWSVppp8eaWb/Keif6Tw7Jc60wbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033