UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jAAZ0G9Cngmi/tka7eVK/k7YZd30l+cBD43jzOfnBmo=' 
WHERE 
  key_id = '4064769c857698e6097acb83c7bb48f6b41011e1cf91ec9f59328a67b7cf9dc0' 
  AND (
    token = 'jAAZ0G9Cngmi/tka7eVK/k7YZd30l+cBD43jzOfnBmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030