UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iciXtGtDVXluPlAyaReki03JSyndTdrvkLrT9k/uP6o=' 
WHERE 
  key_id = '2552ed3b4c07e673cf0286aab3b752dc7936165624a9503e1b9ec27debe6fa0e' 
  AND (
    token = 'iciXtGtDVXluPlAyaReki03JSyndTdrvkLrT9k/uP6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038