UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nK/YKfJc7z3B0ssVSKZofyexFQPlDfUJDmCBG70FzRA='
WHERE
key_id = '07157f46c224c91edb1dd01525ab3b97e0dad2a95c7a7d870b6b46f1df6b707f'
AND (
token = 'nK/YKfJc7z3B0ssVSKZofyexFQPlDfUJDmCBG70FzRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)