UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+PS+slQthSze4wjIGav9F0kxMYHJLqhIFSvoYMWVvys='
WHERE
key_id = 'd67104dc3d79985644b7d35d0e11c3fab4979a3fa9bf501202ef6c6ff2195107'
AND (
token = '+PS+slQthSze4wjIGav9F0kxMYHJLqhIFSvoYMWVvys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)