UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bc5GVykHP7wN1n2nXE534zqawTOyXlYyICZ8y1FdnE='
WHERE
key_id = '09e65a42a0ac752cc08a1978b132ac20c01e0d05926d5b6605d282b261dbb523'
AND (
token = '1bc5GVykHP7wN1n2nXE534zqawTOyXlYyICZ8y1FdnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)