UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IR8lQX3SZ4nRNBvKS5bRQGFY1Pe/k/w+EUYeE/6+xDM=' 
WHERE 
  key_id = '8fe67432e1e9790f5df57fa03ce7d446fb3a0db6b2306d33da2a5919f723edfa' 
  AND (
    token = 'IR8lQX3SZ4nRNBvKS5bRQGFY1Pe/k/w+EUYeE/6+xDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031