UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6QRP+LEUIK0XwzL29zVgBM31oxabjcOhK269KFBnXQU='
WHERE
key_id = '512b321858f8462e9477dbb04fe9b22be8e534079e73075c5cf918bcdf87d6a7'
AND (
token = '6QRP+LEUIK0XwzL29zVgBM31oxabjcOhK269KFBnXQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)