UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y1uXG/6Psg14nfP7Y+2VbEfbL8dj4ih/fsWYL/48Onw='
WHERE
key_id = 'a53608cfda30f6effe1094a6cd41c5e559a9f0ff0e828e13d63a31a8352f660e'
AND (
token = 'y1uXG/6Psg14nfP7Y+2VbEfbL8dj4ih/fsWYL/48Onw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)