UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMuUPXjXoUK6KAhASYyslGluzg/jUKrQUYRGJfcwpyE='
WHERE
key_id = 'e64a60692a039b330c3d80077ccf01015f9f1da0e90a00e1aa61e64b0e42bcb8'
AND (
token = 'QMuUPXjXoUK6KAhASYyslGluzg/jUKrQUYRGJfcwpyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)