UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zSRY2gCEGxhiX3HE3hxfUWCJ6P4KtIlFaJhzUhOeoOk='
WHERE
key_id = '8db533ec5bcec9f9e82f8a0d106c3bce462912e001cb01f7d222f980f0a3126d'
AND (
token = 'zSRY2gCEGxhiX3HE3hxfUWCJ6P4KtIlFaJhzUhOeoOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)