UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VhWJVXmvBIVEiZ4o6p4DZZXWGvkUdRZKh8wnG3A+WfI=' 
WHERE 
  key_id = '7b9bb8b6c9dce81f59c5ea5ad08f4419ed4969c6e36c47473afffdf66e95a67d' 
  AND (
    token = 'VhWJVXmvBIVEiZ4o6p4DZZXWGvkUdRZKh8wnG3A+WfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040