UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4sfo/Yw+a1xDuebflEudvGb1erpzKRfltzCUk3jTtnk=' 
WHERE 
  key_id = 'd42938134e202003d64b321dd7c3e9d8a9c8557473c5e7d173596e76c2c0128a' 
  AND (
    token = '4sfo/Yw+a1xDuebflEudvGb1erpzKRfltzCUk3jTtnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032