UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MlftDs0Rpmj2O7IoXMIU4uiKmHevPuS/nfMMhhl2Fi0=' 
WHERE 
  key_id = '160c36a9b3f1148b90be19b2a60ae4b5fa00c462d3e69205ea1e174470a5e86a' 
  AND (
    token = 'MlftDs0Rpmj2O7IoXMIU4uiKmHevPuS/nfMMhhl2Fi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042