UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vqOl5/M2RvmG5a5jzjKuqQ25wlfJK2sXRfxq0UJFgQw=' 
WHERE 
  key_id = '0422b40e6e89838a5b2d4686d410c54f4449e9d2112e15bbf9e60d34206ad031' 
  AND (
    token = 'vqOl5/M2RvmG5a5jzjKuqQ25wlfJK2sXRfxq0UJFgQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016