UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GPN0EgPvk2M4mifoV9Z/yEbSgZSKRNAIffuRz1j4y7E='
WHERE
key_id = '059607cede31471beec5da2c4f0f0227fff3fcce52fdb5282ede15daf85dc32f'
AND (
token = 'GPN0EgPvk2M4mifoV9Z/yEbSgZSKRNAIffuRz1j4y7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)