UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/DamI2w5oZgYHyzZ73VL9UHlP0chnfHJqdeMgDI5sc='
WHERE
key_id = 'f2df3eff7e42650772f93022373181a4dbdb10655de17e1d574c9ae6d902587e'
AND (
token = 'V/DamI2w5oZgYHyzZ73VL9UHlP0chnfHJqdeMgDI5sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)