UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+unVseOjlnWiXpoH5S86B5Df0vhGSYAoO+LJx5sU/xM='
WHERE
key_id = '7b29eb14a4d1ea2eeb05725b542d88728d3c986c7ce49a035727f007fe869d7c'
AND (
token = '+unVseOjlnWiXpoH5S86B5Df0vhGSYAoO+LJx5sU/xM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)