UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kKofcmeq4HyaPJD6ykUaBdCzFazpyi5NRD5sw7qGTyY=' 
WHERE 
  key_id = '6d4e7ceca5814240c2e3fc4e99836a198738ce562f8fcbd1a90c5c6c36bf332f' 
  AND (
    token = 'kKofcmeq4HyaPJD6ykUaBdCzFazpyi5NRD5sw7qGTyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029