UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuRRq9cG/yo1VrTsaplzGkCfTHkENW7KwwfzGmvZktQ='
WHERE
key_id = 'cabb145b80ba58fa8b321317769680ec6608d41bd89061e9f1505a3265395e3f'
AND (
token = 'RuRRq9cG/yo1VrTsaplzGkCfTHkENW7KwwfzGmvZktQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)