UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kmSGWsOi66DAyAgI6YY74ySCnumcMAWts9yVfAjVKUU='
WHERE
key_id = '76732c20474769e5f0fa7b699ee908eddad2f50e193f7ea91eb0ebfacd37353a'
AND (
token = 'kmSGWsOi66DAyAgI6YY74ySCnumcMAWts9yVfAjVKUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)