UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tlwkNn5f96bCWVeUHh0wAP7jD0kKu76b1rSAt3jYVZU=' 
WHERE 
  key_id = '92433029215dd19f73f39b3518a1d0f74330cb95b15b199f0835cf8e243f7783' 
  AND (
    token = 'tlwkNn5f96bCWVeUHh0wAP7jD0kKu76b1rSAt3jYVZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046