UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ooqGgRx5ny3P56a5xKSX/5lEVYvCFQqmvmSx8f6GtpQ=' 
WHERE 
  key_id = '7e2162730f000662de2c5ad549033502550a5fb169413ff2bd710069632332cd' 
  AND (
    token = 'ooqGgRx5ny3P56a5xKSX/5lEVYvCFQqmvmSx8f6GtpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020