UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4SiqkJF3ZpX75il6bf2wvB0i2ZRZyP9PNCd5QoBnSO4=' 
WHERE 
  key_id = 'a42a89b73c7058bdc1adaa3fd919a719313c90cc680ce3fb1e308d276a81ff58' 
  AND (
    token = '4SiqkJF3ZpX75il6bf2wvB0i2ZRZyP9PNCd5QoBnSO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029