UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '92gHWr+WZfWE6dTj6KiOUWae/ZHyr85JMxt6Ud4VkZU=' 
WHERE 
  key_id = '6e51685ab076b9f9bb0c79b9d89d1c5b8069a64559f6c8f34b173fffeae8baeb' 
  AND (
    token = '92gHWr+WZfWE6dTj6KiOUWae/ZHyr85JMxt6Ud4VkZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016