UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LMHcFwutuiX8M9Q/cmTleHr/yw4DRYoz5RH77ffXokg=' 
WHERE 
  key_id = '30ef2e50e1eab65eb118d2d12439ce7c7f55cf59508664f86c37d10426337f49' 
  AND (
    token = 'LMHcFwutuiX8M9Q/cmTleHr/yw4DRYoz5RH77ffXokg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047