UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FNqxRYxiMJTtBsIET/bw2nTFojLHqq1GiR9wsVePOig='
WHERE
key_id = '64613fe582e231e31b5ba9019255d5dbc1ca3f492fec59a843ac067d3672a4cd'
AND (
token = 'FNqxRYxiMJTtBsIET/bw2nTFojLHqq1GiR9wsVePOig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)