UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UBC0XXxBRiI/mHePwwZVcQgwPwLqCnpcmI5ltN5454Y='
WHERE
key_id = '5b796c537272b369ad71cbded55667cc1b4387de5d7dfbdd950248db7c28b051'
AND (
token = 'UBC0XXxBRiI/mHePwwZVcQgwPwLqCnpcmI5ltN5454Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)