UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hb6n18Dzlb+7+ve4nnKBitHeUzKwh/G6TY4yjRi1kyE=' 
WHERE 
  key_id = '217e832aeccdc7a09494d72c38976aabe174b4a8f04f4aab36da2a5992ea70e9' 
  AND (
    token = 'Hb6n18Dzlb+7+ve4nnKBitHeUzKwh/G6TY4yjRi1kyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031