UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LeDec2R8g+o8xO71qm7dRC5yofGAa7uN1/WxGZq/yPU=' 
WHERE 
  key_id = '73f39c90935cd02247bd7b16161ff29cf71a716ec6679b41cebe5d9c5ee2e2b9' 
  AND (
    token = 'LeDec2R8g+o8xO71qm7dRC5yofGAa7uN1/WxGZq/yPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020