UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTkhx0A68a9NEQtdOBpxN1VWP7GJm+7Rzm4r9RS1aik='
WHERE
key_id = '8c09d697491e863ebf82c0857d230060ee9ceb530985fdc51a49eb002a0054a8'
AND (
token = 'qTkhx0A68a9NEQtdOBpxN1VWP7GJm+7Rzm4r9RS1aik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)