UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmuafDlmSoE4bVXhC/ALSZRt7qTKtVeu9IaqHUTjpkQ=' 
WHERE 
  key_id = '3355d04800885060e84f5f05acc32b06ff33f2b1d6e59115033c4646f3cadf91' 
  AND (
    token = 'ZmuafDlmSoE4bVXhC/ALSZRt7qTKtVeu9IaqHUTjpkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038