UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n88agqwPWGjTWbEByQGU4MMRoQxxxc5meEd/gqleR28='
WHERE
key_id = '914d452df6ef2ebc4e3fc3d3893b6cba41aca1898a42b45cb749f257d7baedd1'
AND (
token = 'n88agqwPWGjTWbEByQGU4MMRoQxxxc5meEd/gqleR28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)