UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LF5U5uHn0cWNBGy6vaNKFy0GIbrWrh6rbEsl9dP5Xco='
WHERE
key_id = 'b66482f7c49ab40884bd9fbe66b9706005ae1c7c6190fbb855a1eb686eb7be37'
AND (
token = 'LF5U5uHn0cWNBGy6vaNKFy0GIbrWrh6rbEsl9dP5Xco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)