UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xZe9McrtFa1dc5PWY4dBhjA9Ph8aIOGqqy9L1VrO/9w=' 
WHERE 
  key_id = 'abbf1cff1233420b98dc272dacaa9f63e674515f55d9f18e4e83502f1fcf0376' 
  AND (
    token = 'xZe9McrtFa1dc5PWY4dBhjA9Ph8aIOGqqy9L1VrO/9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034