UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sz4zYTiCZx6532Y9ljraRcJ2KeObFLzDHQNNxUIffCM=' 
WHERE 
  key_id = '34c067cc0cb7279f95602c8512655d2f6f9fa91333316b2b7dbb9080851dc50e' 
  AND (
    token = 'Sz4zYTiCZx6532Y9ljraRcJ2KeObFLzDHQNNxUIffCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027