UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UNMw+hOGkgoOEcBfcJFe6DWNNkEer9M2zAd/SvOfz64=' 
WHERE 
  key_id = '39eea9e0d285598561b4cda3225f44aeaf454b00e4a955afeb57a68cd4a069c8' 
  AND (
    token = 'UNMw+hOGkgoOEcBfcJFe6DWNNkEer9M2zAd/SvOfz64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035