UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GzmE/DPy6d07yu+PdcOLLCv7SxNFkxNtn6ybOd2lA5Y='
WHERE
key_id = 'c8b9bd1c39d4a2e3e22c6e7ef6197bf2b1b79e9ed537921a43927fd15ecf2459'
AND (
token = 'GzmE/DPy6d07yu+PdcOLLCv7SxNFkxNtn6ybOd2lA5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)