UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81l7cU9+5CSeDNAWKI3xG4KpU6fD7H/r8/ca3bXHcfs=' 
WHERE 
  key_id = '89d76e53e96d0f66326c7203a95bce065b75dae1453317b2b324a6a98b9f2880' 
  AND (
    token = '81l7cU9+5CSeDNAWKI3xG4KpU6fD7H/r8/ca3bXHcfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034