UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v4XyPFafPrPaW2L+BcmvtaygpEeuHG84k5JxJx2btQk=' 
WHERE 
  key_id = '115f8e14b2ed45fe366ddd236cca88ec90eeee795acd1103cd130ad5b197020b' 
  AND (
    token = 'v4XyPFafPrPaW2L+BcmvtaygpEeuHG84k5JxJx2btQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025