UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pU1HDFhzknUHwfyRUpPTo+xeJGunW0JKQXzbhDsL/J8='
WHERE
key_id = 'e94f5e29c7c656ec534a412a82efec2d61e0f1079e5db2d30e7f55f2e26614d4'
AND (
token = 'pU1HDFhzknUHwfyRUpPTo+xeJGunW0JKQXzbhDsL/J8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)