UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '05IPCKiYpgJ8IBolyv7dXvXopVDXjxzy7/X+ATTl8kU=' 
WHERE 
  key_id = '15bb8998e4a4d652f79e1c9c58fd8a4fc38f7bf81eabd07d390a7ebcc8a2af72' 
  AND (
    token = '05IPCKiYpgJ8IBolyv7dXvXopVDXjxzy7/X+ATTl8kU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028