UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5hjf4AP8GUiaQ64veZGlOjZa7qD0Nxk9Ki6Hk2gijIM='
WHERE
key_id = '24669a1f5037bc8d0d39b7e98c4d9f1649cd976a665e0c415aa44605379424df'
AND (
token = '5hjf4AP8GUiaQ64veZGlOjZa7qD0Nxk9Ki6Hk2gijIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)