UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ktEiefKE4ldgQ8R7y2obCNbdXRBBOBl7GzJBjZER10c=' 
WHERE 
  key_id = '72ba72d37c1c63192b811fb8d249e3565c86df8db91dc2c4e17bb8f260af37ab' 
  AND (
    token = 'ktEiefKE4ldgQ8R7y2obCNbdXRBBOBl7GzJBjZER10c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036