UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLbbA5oKLZESKlKVzmRSghJ/FkG62JFe7Gg3cyA2q7o='
WHERE
key_id = '24b3f3080262ce012017a2cc5bf2c019d4b005bf44f110284b8e45777f56229b'
AND (
token = 'iLbbA5oKLZESKlKVzmRSghJ/FkG62JFe7Gg3cyA2q7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)